import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.PrintStream;
import java.util.Scanner;


public class BaguncaIris {
	
	static final int N = 150, M = 4;
	static final int Q = 1;
	static final int scale = 50;
	
	public static double bagunca(double x, double fatorMultiplitivo, double fatorAditivo) {
		return x*fatorMultiplitivo + fatorAditivo;
	}
	
	public static int getCluster(String s) {
		if(s.equalsIgnoreCase("Iris-setosa")) return 1;
		if(s.equalsIgnoreCase("Iris-versicolor")) return 2;
		if(s.equalsIgnoreCase("Iris-virginica")) return 3;
		return -1;
	}
	
	public static void main(String[] args) throws Exception {
		Scanner scanner = new Scanner(new File("in.txt"));
		int cluster[] = new int[N];
		double x[][] = new double[N][M];
		for(int it = 0; it < N; it++) {
			String pieces[] = scanner.nextLine().split(",");
			for(int i = 0; i < M; i++) {
				x[it][i] = Double.parseDouble(pieces[i]);
			}
			cluster[it] = getCluster(pieces[4]);
		}
		
		double _fatorMultiplitivo[] = { 700 };
		int _variavel[] = {1,2,4,8}; int f[] = new int[100]; f[0] = 0; f[1] = 1; f[2] = 2; f[4] = 3; f[8] = 4;
		int _alterar[] = {1,2,3,5,7};
		
		int id = 1;
		for(double fatorMultiplitivo : _fatorMultiplitivo)
		for(int variavel : _variavel)
		for(int alterar : _alterar)
		for(int q = 1; q <= 1; q++)
		{ // begin loops
		
		String _ = "" + id++;
		while(_.length() < 2) _ = "0" + _;
			
		//PrintStream printStream = new PrintStream(new File("Iris/" + _ + "-iris-bagunca(variavelAlterada=" + f[variavel] + ",alterados="+ alterar + ").sds"));
		
		String kkk = ("Iris/" + _ + "-iris-bagunca(variavelAlterada=" + f[variavel] + ",alterados="+ alterar + ").sds");
		PrintStream printStream = new PrintStream("Config/" + _ + "-config.txt");
		
		printStream.println("(Number_of_initializations)\n100\n");
		printStream.println("(Class_variable)\n1\n");
		printStream.println("(Number_of_individuals)\n150\n");
		printStream.println("(Number_of_iterations)\n150\n");
		printStream.println("(Tmin)\n0.0\n");
		printStream.println("(Tmax)\n0.0\n");
		printStream.println("(Input_file)\n" + kkk + "\n");
		printStream.println("(Output_file)\n" + id + ".txt\n");
		printStream.close();
		
		if(true) continue;
		
		int falta[] = new int[] { 0, alterar, alterar, alterar };
		int esse[] = new int[N];
		
		for(int foi = 0; foi < alterar*3; foi++) {
			while(true) {
				int w = (int)(Math.random() * N);
				if(esse[w] != 0) continue;
				if(falta[cluster[w]] <= 0) continue;
				esse[w] |= variavel;
				falta[cluster[w]]--;
				//System.err.println(w);
				break;
			}
		}
		// generate file
		printStream.println("RECTANGLE_MATRIX = (");
		for(int it = 0; it < N; it++) {
			printStream.print("(" + cluster[it]);
			for(int i = 0; i < M; i++) {
				double res = x[it][i];
				if((esse[it] >> i & 1) != 0) {
					res = bagunca(res, fatorMultiplitivo, 0);
				}
				printStream.printf(",(%.4f : %.4f)", res, res);
			}	
			printStream.print(")");
			if(it+1 != N) printStream.print(",");
			printStream.println();
		}
		printStream.println(")");
		printStream.close();
		} // end loops
		
	}
}